﻿namespace DCHealthCheck.MvcWeb.Classes {

    #region Usings
    using DCHealthCheck.Common;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web; 
    #endregion

    [Serializable]
    public class WebErrorInfo {

        public WebErrorInfo(Exception exception, string controllerName, string actionName, string url = "") {
            if (exception == null) {
                throw new ArgumentNullException("exception");
            }
            if (string.IsNullOrWhiteSpace(controllerName)) {
                throw new ArgumentException("Controller name not specified", "controllerName");
            }
            if (string.IsNullOrWhiteSpace(actionName)) {
                throw new ArgumentException("Action name not specified", "actionName");
            }

            this.Exception = exception;
            this.ControllerName = controllerName;
            this.ActionName = actionName;
            this.ExceptionDetails = this.Exception.VerboseExceptionString();
            this.Url = url;
        }

        public string ActionName { get; private set; }

        public string ControllerName { get; private set; }

        public Exception Exception { get; private set; }

        public string ExceptionDetails { get; private set; }

        public string Url { get; private set; }
    }
}